def getMenuOption(debug = False):
	if debug:
		print "getMenuOption Function"
	validInput = False
	while not validInput:
		option = raw_input("> ")
		option = option.lower()
		if option == "1":
			validInput = True
		elif option == "2":
			validInput = True
		elif option == "3":
			validInput = True
		elif (option == "o" or 
			  option == "options"):
				  option = "o"
				  validInput = True
		elif (option == "exit" or
			  option == "x" or
			  option == "quit" or
			  option == "q"):
				  option = "exit"
				  validInput = True
		elif (option =="a" or
		     option =="w" or
		     option =="e"):
				 option = "egg1"
				 validInput = True
		elif (option =="r" or
		     option =="t" or
		     option =="y"):
				 option = "egg2"
				 validInput = True
		elif (option =="u" or 
		     option =="i" or 
		     option =="l"):
				 option = "egg3"
				 validInput = True
		elif (option =="p" or
		     option =="k" or
		     option =="j"):
				 option = "egg4"
				 validInput = True
		elif (option =="h" or
		     option =="g" or
		     option =="f"):
				 option = "egg5"
				 validInput = True
		elif (option =="d" ):
				 option = "egg6"
				 validInput = True
		elif (option =="c" or
		     option =="v" or
		     option =="b"or
		     option =="s" or
		     option =="z"):
				 option = "egg7"
				 validInput = True
		elif (option =="n" or
		     option =="m" or
		     option =="4"):
				 option = "egg8"
				 validInput = True
		elif (option =="5" or 
		     option =="6" or
		     option =="7"):
				 option = "egg9"
				 validInput = True
		elif (option =="8" or
		     option =="9" or
		     option =="0"):
				 option = "egg10"
				 validInput = True                     
		else:
			print "please type a valid option"
			validInput = False
	if debug:
		print "Option is: 1, 2, 3, o, options, exit, x, q, quit" 
	return option
			
def getWord(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		validInput = True
		if option == "":
			print "Please type a word"
			validInput = False
		elif isSwear(option, debug):
			print "My mommy doesn't allow me to say those things."			
			validInput = False
		elif isNum (option, debug):
			print "Please enter a word"
			validInput = False
	if debug:
		print "Option: ", option 
	return option

def getNumber(prompt, debug = False):
	if debug:
		print "getNumber Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		allowedChars = "1234567890,."
		validInput = True
		for letter in option:
			if debug:
				print letter
			if not(letter in allowedChars):
				validInput = False
		if not validInput:
			print "please type a number"
	if debug:
		print "Option: ", option
	return option
			
def isSwear(word, debug = False):
	if debug: 
		print "In isSwear Function", word
	swearList = ["ass",
				"fuck",
				"sex",
				"bitch",
				"cunt",
				"dick",
				"shit",
				"damn",
				"bastard",
				"motherfucker",
				"assfuck",
				"vagina",
				"crap",
				"asshoole"]
	if word.lower() in swearList:
		return True
	else:
		return False

def getJob(prompt, debug = False):
	if debug:
		print "getJob Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		validInput = True
		if option == "":
			print "please type a word"
			validInput = False
		elif isSwear(option, debug):
			print "Don't say such naughty things!"			
			validInput = False
	if debug:
		print "Option: ", option 
	return option

def getFamily(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		validInput = True
		if option == "":
			print "please type a word"
			validInput = False
		elif isSwear(option, debug):
			print "Don't say such naughty things!"			
			validInput = False
	if debug:
		print "Option: ", option 
	return option

def isNum(word, debug = False):
	if debug:
		print "In isNum Function,", word
	numList = ["1",
			   "2",
			   "3",
			   "4",
			   "5",
			   "6",
			   "7",
			   "8",
			   "9",
			   "0",
			   "."]
	if word.lower() in numList:
		return True
	else:
		return False

